package com.wang.store.service.impl;

import com.wang.store.entity.District;
import com.wang.store.entity.User;
import com.wang.store.mapper.DistrictMapper;
import com.wang.store.mapper.UserMapper;
import com.wang.store.service.IDistrictService;
import com.wang.store.service.IUserService;
import com.wang.store.service.ex.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

import java.util.Date;
import java.util.List;
import java.util.UUID;


/**
 * 用户模块业务层实现;
 */
@Service
public class DistrictServiceImpl implements IDistrictService {
    @Autowired
    DistrictMapper districtMapper;


    @Override
    public List<District> getByParent(String parent) {
        List<District> list = districtMapper.findByParent(parent);
        for (District district : list) {
            district.setId(null);
            district.setParent(null);
        }
        return list;
    }

    @Override
    public String getNameByCode(String code) {
        return districtMapper.findByNameByCode(code);
    }
}
